﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity.ModelConfiguration;

namespace BlogKickStart.Models.Mapping
{
	public class CommentMap : EntityTypeConfiguration<Comment>
	{
		public CommentMap()
		{
			this.HasKey(t => t.CommentID);
			// Table & Column Mappings
			this.ToTable("Comments");
			this.Property(t => t.PostID).HasColumnName("PostID");
			this.Property(t => t.CommentID).HasColumnName("CommentID");
			this.Property(t => t.UserID).HasColumnName("UserID");
			this.Property(t => t.UnmarkedContent).HasColumnName("UnmarkedContent");
			this.Property(t => t.MarkedContent).HasColumnName("MarkedContent");
			this.Property(t => t.CommentDate).HasColumnName("CommentDate");


			this.HasRequired(t => t.Post).WithMany(a => a.Comments).HasForeignKey(d => d.PostID);
	
		}
	}
}